-- Spider Grotto

function autoexec()
 
return
end

function refresh()
  return
end

function postexec() 
return

end


function zone_handler(zn)
  if (zn == 0) then
 if (get_progress(P_SPIDER) == 0) then
    combat(56); 
end

  elseif (zn == 1) then
    change_map("townx","grotto2_exit");

  elseif (zn == 2) then
 if (get_progress(P_SPIDER) == 0) then
    combat(57); 
end

  elseif (zn == 3) then 
 if (get_progress(P_SPIDER) == 0) then
    combat(58); 
end

  elseif (zn == 4) then 
 if (get_progress(P_SPIDER) == 0) then
    combat(59);  
end

  elseif (zn == 5) then
    bubble(HERO1,"Ugh this must be the spiderasts lair.. ");
    drawmap()
    screen_dump()
    set_run(0)
    combat(20)
    set_run(1)
    if (get_alldead() == 1) then
      return
    end
    set_progress(P_SPIDER, 1)
    drawmap()
    screen_dump()


  elseif (zn == 6) then
if (get_treasure(31) == 0) then     
    if (get_progress(P_PLANTLORE) == 1) then
      --You recognize a medicinal herb
      msg("You recognize a Medicinal Herb", 255, 0)
      chest(31, I_MHERB, 1)
    end
end

  elseif (zn == 7) then
if (get_treasure(32) == 0) then 
    if (get_progress(P_PLANTLORE) == 1) then
      --You recognize a poison cure herb
      msg("You recognize a Neliram Leaf", 255, 0)
      chest(32, I_NLEAF, 1)
    end
end

  elseif (zn == 8) then
if (get_treasure(33) == 0) then 
    if (get_progress(P_PLANTLORE) == 1) then
      msg("You recognize a Medicinal Herb", 255, 0)
      chest(33, I_MHERB, 1)
    end
end

  elseif (zn == 9) then
if (get_treasure(34) == 0) then 
    if (get_progress(P_PLANTLORE) == 1) then
      msg("You recognize a Medicinal Herb", 255, 0)
      chest(34, I_MHERB, 1)
    end
end

  elseif (zn == 10) then
if (get_treasure(35) == 0) then 
    if (get_progress(P_PLANTLORE) == 1) then
      msg("You recognize a Neliram Leaf", 255, 0)
      chest(35, I_NLEAF, 1)
    end
end

  elseif (zn == 11) then
if (get_treasure(36) == 0) then 
    if (get_progress(P_PLANTLORE) == 1) then
      msg("You recognize a Medicinal Herb", 255, 0)
      chest(36, I_MHERB, 1)
    end
end

  elseif (zn == 12) then
if (get_treasure(37) == 0) then 
    if (get_progress(P_PLANTLORE) == 1) then
      msg("You recognize a Medicinal Herb", 255, 0)
      chest(37, I_MHERB, 1)
    end
end

  elseif (zn == 13) then
if (get_treasure(38) == 0) then 
    if (get_progress(P_PLANTLORE) == 1) then
      msg("You recognize a Neliram Leaf", 255, 0)
      chest(38, I_NLEAF, 2)
    end
end

  elseif (zn == 14) then
if (get_treasure(39) == 0) then 
    if (get_progress(P_PLANTLORE) == 1) then
      msg("You recognize a Medicinal Herb", 255, 0)
      chest(39, I_MHERB, 1)
    end
end

     end      

end
 
-- 
function entity_handler(en)
  if (en == 0) then
  end
end
